<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改企业简介')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-companyinfo-edit" th:object="${companyInfo}">
            <input name="id" th:field="*{id}" type="hidden">
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label is-required">企业ID：</label>-->
<!--                <div class="col-sm-8">-->
                    <input name="companyId" th:field="*{companyId}" class="form-control" type="hidden" required>
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">企业简介：</label>
<!--                <div class="col-sm-8">-->
<!--                    <input name="info" th:field="*{info}" class="form-control" type="text">-->
<!--                </div>-->
                <div class="col-sm-8">
                    <div class="ibox-content no-padding">
                        <div class="summernote" th:utext="${companyInfo.info}">
                        </div>
                    </div>
                    <input id="info" name="info" th:field="*{info}" class="form-control" type="hidden">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: summernote-js" />
    <script type="text/javascript">
        var prefix = ctx + "jiaqin/companyinfo";
        $("#form-companyinfo-edit").validate({
            focusCleanup: true
        });

        $(document).ready(function () {
            $('.summernote').summernote({
                height: 300,
                lang: 'zh-CN',
                callbacks: {
                    onChange: function(contents, $editable) {
                        // console.log('onChange:', contents, $editable);
                        var aHTML = $('.summernote').summernote('code');
                        console.log(aHTML);
                        $("#info").val(aHTML);
                    }
                }
            });
        });
        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-companyinfo-edit').serialize());
            }
        }
    </script>
</body>
</html>
